

diary 'flyfly.txt'
diary on;
t= 0:1:360;
map =zeros(70,70);
M=70000;
vv = zeros(50,50,50);
plan=zeros(1,7*5);

T = zeros(100);
N = zeros(10);
%% 开始循环过程
for nn = 3:7
    for yg1 = 35000:5000:45000
        for yg2 = 5000:5000:30000
            for t2 = 20:20:340
                for V1 =80:10:80
                    for V2=100:10:100
                        for V3 = 100:10:100
                            for a=1:1:1
                                t1   = 0:0.1:t2;
                                lmax1 = distance(nn);
                                lmax2 = distance(10-nn);
                                
                                [red_f1x, red_f1y]= drop_the_air([0,35000],[50000,yg1]);
                                [red_f2x, red_f2y]= drop_the_air([0,35000],[50000,yg2]);
                                [t1,xxyy] = ode23tb( @(t,y)fly_the_air2(t,y,L1,V1,V2,V3,a,M),t1,[0,35000,50000,yg1,50000,yg2,red_f1x,red_f1y,red_f2x,red_f2y]);
                                [status ,tt] = check_status2(xxyy,M,lmax1);
                                
                                tt2 = t2:0.1:360;
                                lastout = xxyy(length(xxyy),:);
                                [red_f3x, red_f3y]= drop_the_air( xxyy(length(xxyy),1:2),xxyy(length(xxyy),3:4) );
                                [red_f4x, red_f4y]= drop_the_air( xxyy(length(xxyy),1:2),xxyy(length(xxyy),5:6) );
                                %  status 的状态
                                %  0 - 未知
                                % 1 - 拦截成功
                                % -1  ： 曲率不满足条件
                                % 2 ： 突围成功
                                [tt2,xxyy2] = ode23tb( @(t,y)fly_the_air3(t,y,L1,V1,V2,a,M),tt2,[lastout(1),lastout(2),lastout(7),lastout(8),lastout(8),lastout(10),red_f1x,red_f1y,red_f2x,red_f2y]);
                                [status2 ,tst2] = check_status3(xxyy2,M,[lmax1,lmax2]);
                               
                                if status == 1 ||( status2 == 1 )
                                    map(yg1/1000,yg2/1000)=  map(yg1/1000,yg2/1000)+1;
                                  N(nn)=N(nn)+1;
                                    T(t2/10) = T(t2/10) +1;
                                    disp(yg1);
                                    disp(yg2);
                                        disp("   --------  ");
                                end
                                
                                
                                
                                
                                
                            end
                        end
                    end
                end
            end
        end
    end
end
diary off;
save("q3.mat");